Menu

Wiki usage

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.
Edit Sidebar
Main > SupportingMoreFeatures

Supporting more features in MOHRadiant

This tutorial is mostly file management and editing, there's no ingame and very little editor usage.

To start out with, you need to understand where and what these feature's i'm going to talk about are.

what i mean is things such as func_rotatingdoor and func_door, everyone should know these. they're Quake 3 supported things that do special tasks with a simple set of instructions for mappers. these do not come up in the editor unless you have the entdefs folder in your main, ever wondered what's in entdefs?

it's a bunch of .cpp (C++, it's a programming language) files, you can open them with Notepad and look at them. it's probably pretty confusing.

but the main thing is knowing that these are what create support for func_ and info_ things.

for this tutorial, i decided i'd show you how to support a very useful one that is not used in stock MOHAA; func_beam.

first off, you need the source file for it, (.cpp) it's not a very well documented procedure, and not many people use it, so finding new ones can be a hassle. fortunately, i have the working file for func_beam in my possession.

here's the process...

Get your source file

...for func_beam i used this one.


 /*QUAKED func_beam (0 0.25 .5) (-8 -8 -8) (8 8 8) START_ON PERSIST WAVE NOISE 

 This creates a beam effect from the origin to the target's origin. If no 
 target is specified, uses angles and projects beam out from there. 

 Values: 
 ======= 

 "activate" Activate the beam 
 "alpha" Alpha of the beam (Default is 1.0) 
 "angle" ( Float newAngle ) set the angles of the entity using just one value.  Sets the yaw of the entity or an up and down direction if newAngle is [0-359] or -1 or -2 
 "angles" ( Vector newAngles<0.00...360.00><0.00...360.00><0.00...360.00> ) set the angles of the entity to newAngles. 
 "color" Vector specifiying the red,green, and blue components. (Default is "1 1 1") 
 "damage" Amount of damage the beam inflicts if beam hits someone (Default is 0) 
 "deactivate" Deactivate the beam 
 "delay" ( Float delay ) Set the amount of delay on the beam updater (i.e. slows the effect of the beam down) 
 "doActivate" ( Entity activatingEntity ) General trigger event for all entities 
 "endalpha" ( Float alpha ) Set the endpoint alpha value of the beam 
 "endpoint" ( Vector beam_end_point ) Set the end point of the beam. The beam will be draw from the origin to the end point. 
 "findendpoint" Find the endpoint of a beam 
 "life" ( Float beam_life ) Sets the life of the beam for use with the persist spawnflag.  This is how long a beam will be displayed. 
 "maxoffset" ( Float max_offset ) Set the maximum offset the beam can travel above, below, forward or back of it's endpoints (Default is 5) 
 "minoffset" ( Float min_offset ) Set the minimun offset the beam can travel above, below, forward or back of it's endpoints (Default is 0) 
 "model" Specifies the model to use as the beam 
 "numsegments" ( Integer numsegments ) Set the number of segments for the beam (Default is 4) 
 "numspherebeams" ( Integer num ) Set the number of beams that will be shot out in a sphere like formation 
 "overlap" ( Float beam_overlap ) Specifies the amount of overlap each beam link should have. Use this to fill in the cracks when using electric on beams. (Default is 0) 
 "persist" ( Boolean bool ) Set the persist property of the beam 
 "radius" ( Float radius ) Set the starting radius of the beams if this is a beamsphere 
 "scale" Set the width of the beam 
 "shader" ( String beam_shader ) Set the shader that the beam will use 
 "shoot" Make the beam cause damage to entities that get in the way 
 "shootradius" ( Float radius ) Set the radius of the damage area between beam endpoints 
 "target" ( String beam_target ) Set the target of the beam. The beam will be drawn from the origin to the origin of the target entity 
 "tileshader" ( String beam_shader ) Set the shader that the beam will use. This shader will be tiled. 
 "toggledelay" ( [ String [random] ], [ Float time ] ) Causes a beam toggling effect. Sets the time between toggling. If random is specified, The time will be between 0 and time 
 "updateendpoint" Update the endpoint of a beam 
 "updateorigin" Update the origin of a beam 

 START_ON  - Starts the beam on 
 PERSIST   - Keeps the last few beams around and fades them out over the life of the beam 
 WAVE      - Make the beam follow a sin wave pattern 
 NOISE     - Use a more computationally expensive random effect, but the results are smoother 

 If the model field is not set, then a renderer generated beam will be created 
 using the color, minoffset, maxoffset, scale, and subdivisions fields 

 If the targetname is set, it will use the target specified as the endpoint of the beam 
 *****************************************************************************/

Copy this to Notepad and save as func_beam.cpp

Place it

Cut/paste into your entdefs.pk3 file in MOHAA -> main. make sure toput it in the code folder. You can also just put in the <install directory>MOHAA/main/code/ directory ( create iot if it does not exist ).

Test it

To check how it works, open Radiant and right click, make sure func_beam is there. if it is, you have successfully supported a new feature!

some notes

cheers, i hope you liked this tut :D

- reptilian_mapper

Recent Changes Printable View Page History Edit Page [Attributes] [Printable View] [WikiHelp]
Page last modified on January 31, 2005, at 03:26 AM